package cqie.personal.frame.bo;


import cqie.personal.frame.exception.ValidationFailException;

public class AddModifyBO {
    private Integer id;
    private String name;
    private Boolean abandon;
    private Integer operator;
    private String info;

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        if(!info.equals("")) {
            if(!info.replace(" ","").equals("")) {
                this.info = info;
            }
        }
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        if(!name.equals("")) {
            if(!name.replace(" ", "").equals("")) {
                this.name = name;
            }
        }
    }

    public Boolean getAbandon() {
        return abandon;
    }

    public void setAbandon(Boolean abandon) {
        this.abandon = abandon;
    }

    public Integer getOperator() {
        return operator;
    }

    public void setOperator(Integer operator) {
        this.operator = operator;
    }

    public boolean Validate() throws ValidationFailException {
        if(this.name==null){
            throw new ValidationFailException("name should not be blank");
        }
        if(this.operator==null){
            throw new ValidationFailException("operator should not be blank");
        }
        return true;
    }
}
